appName='mall-campaign-service-1.0.0.jar'
pids=`ps -ef | grep $appName | grep -v 'grep' | awk '{print $2}'`
for pid in $pids;
do
if [ -n "$pid" ]
then
  kill -9 $pid
fi
done;
for((i=0;i<100;i++))
do
processNum=`ps -ef | grep $appName | grep -v grep | wc -l`
if [ $processNum -eq 0 ]
then
  echo '已经kill，开始启动项目'
  nohup java -jar -javaagent:/app/iast_agent.jar $appName &
break
else
  echo '还没kill'
  sleep 3s
fi
done;
